package com.offcn.controller;

import com.github.pagehelper.PageInfo;
import com.offcn.pojo.Evaluate;
import com.offcn.service.EvaluateService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@RestController //等价于@Controller + @ResponseBody
@RequestMapping("evaluate")
public class EvaluateController {

    @Autowired
    private EvaluateService evaluateService;

    @RequestMapping("list")
    public PageInfo<Evaluate> lists(@RequestParam(defaultValue = "1") int currentPage,@RequestParam(defaultValue = "3") int pageSize){
        PageInfo<Evaluate> pageInfo = evaluateService.queryList(currentPage, pageSize);
        return pageInfo;
    }
}
